#include <stdio.h>
#include <stdlib.h>

void validMountainArray(int* arr, int len) {
    int uping=1;
    for (int i=1;i<len;i++) {
        if (arr[i]==arr[i-1]) {
            printf("false");
            return;
        }
        if (arr[i]>arr[i-1] && !uping ) {
            printf("false");
            return;
        }
        if (arr[i]<arr[i-1] && uping) uping=0;
    }
    if (uping) printf("false");
    else printf("true");
}

int main()
{
    int n;
    scanf("%d",&n);
    int *numbers = (int*) malloc(sizeof(int)*n);
    for (int i=0;i<n;i++)
    {
        scanf("%d",&numbers[i]);
    }
    validMountainArray(numbers,n);
    free(numbers);
    return 0;
}